﻿<UserControl x:Name="UCActiveDirectory"
             x:Class="HelpDesk.UserControls.ActiveDirectory"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:my="clr-namespace:HelpDesk.Commands"
             xmlns:r="clr-namespace:System;assembly=mscorlib"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="500"
             Unloaded="UCActiveDirectory_Unloaded"
             Loaded="UCActiveDirectory_Loaded">
    <StackPanel TextBox.LostFocus="StackPanel_LostFocus">
        <Grid Margin="5">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="217" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <TextBlock Text="Admin User"
                       Margin="0,7,10,4" />
            <TextBox x:Name="txt_AdminUser"
                     Margin="3"
                     Grid.Row="0"
                     Grid.Column="1"
                     Text="{my:SettingBinding txt_AdminUser}" />

            <TextBlock Text="Admin Password"
                       Margin="0,7,10,3"
                       Grid.Row="1" />
            <PasswordBox x:Name="txt_AdminPassword"
                         Margin="3"
                         Grid.Row="1"
                         Grid.Column="1" />

            <TextBlock Text="Domain"
                       Margin="0,7,10,3"
                       Grid.Row="2" />
            <TextBox x:Name="txt_Domain"
                     Margin="3"
                     Grid.Row="2"
                     Grid.Column="1"
                     Text="{my:SettingBinding txt_Domain}" />

            <TextBlock Text="Computer"
                       Margin="0,7,10,3"
                       Grid.Row="3"
                       Style="{StaticResource DesignerWhiteForegroundStyle}" />
            <TextBox x:Name="txt_ComputerSyntax"
                     Margin="3"
                     Grid.Row="3"
                     Grid.Column="1"
                     Text="{my:SettingBinding txt_ComputerSyntax}" />
            <TextBox x:Name="txt_UserName"
                     Margin="3"
                     Grid.Row="4"
                     Grid.Column="1"
                     Text="{}{userName}"
                     Visibility="Collapsed" />



            <TextBlock Text="Computers DistinguishedName OU"
                       Grid.Row="4"
                       Style="{StaticResource DesignerWhiteForegroundStyle}"
                       Margin="0,7,10,3" />
            <TextBox x:Name="txt_ComputersDistinguishedNameOU"
                     Margin="3"
                     Grid.Row="4"
                     Grid.Column="1"
                     Text="{my:SettingBinding txt_ComputersDistinguishedNameOU}" />

            <TextBlock Text="Users DistinguishedName OU"
                       Grid.Row="5"
                       Style="{StaticResource DesignerWhiteForegroundStyle}"
                       Margin="0,7,10,3" />
            <TextBox x:Name="txt_UsersDistinguishedNameOU"
                     Margin="3"
                     Grid.Row="5"
                     Grid.Column="1"
                     Text="{my:SettingBinding txt_UsersDistinguishedNameOU}"/>

            <TextBlock Text="Printers DistinguishedName OU"
                       Grid.Row="6"
                       Style="{StaticResource DesignerWhiteForegroundStyle}"
                       Margin="0,7,10,3" />
            <TextBox x:Name="txt_PrintersDistinguishedNameOU"
                     Margin="3"
                     Grid.Row="6"
                     Grid.Column="1"
                     Text="{my:SettingBinding txt_PrintersDistinguishedNameOU}" />

            <TextBlock Text="prefix ComputerName"
                       Margin="0,7,10,3"
                       Grid.Row="7"
                       Visibility="Visible"
                       Style="{StaticResource DesignerWhiteForegroundStyle}" />
            <TextBox x:Name="txt_prefixComputerName"
                     Margin="3"
                     Grid.Row="7"
                     Grid.Column="1"
                     Text="{my:SettingBinding txt_prefixComputerName}" />


            <TextBlock Text="Sync with Active Directory"
                       Margin="0,7,10,3"
                       Grid.Row="8"
                       Visibility="Visible"
                       Style="{StaticResource DesignerWhiteForegroundStyle}" />

            <StackPanel Grid.Row="8"
                        Grid.Column="1"
                        Orientation="Horizontal">
                <CheckBox Content="Computers"
                          Margin="5"
                          Name="CheckComputers"
                          Tag="1"
                          
                          IsChecked="{my:SettingBinding CheckComputers}" />
                <CheckBox Content="Users"
                          Margin="5"
                          Name="CheckUsers"
                          Tag="2"
                          
                          IsChecked="{my:SettingBinding CheckUsers}" />
                <CheckBox Content="Printers"
                          Margin="5"
                          Name="CheckPrinters"
                          Tag="3"
                          
                          IsChecked="{my:SettingBinding CheckPrinters}" />
                             <!--Checked="StackPanel_Checked"
                          Unchecked="StackPanel_Checked"-->

            </StackPanel>
        </Grid>
    </StackPanel>
</UserControl>
